//
// Created by hi on 24-11-14.
//循环体
#include <stdbool.h>
#include <stdio.h>
int main() {
    printf("倒序99乘法表\n");
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= 9; j++) {
            if(j<i) continue;
            printf("%dx%d=%d\t", i,j,i*j);
        }
        printf("\n");
    }
    printf("正序99乘法表\n");
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= i; j++) {
            printf("%dx%d=%d\t", j,i,i*j);
        }
        printf("\n");
    }
    printf("左对齐三角形\n");
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= i; j++) {
            printf("*");
        }
        printf("\n");
    }
    printf("右对齐三角形\n");
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= 9-i; j++) {
            printf(" ");
        }
        for (int j = 1; j <= i; j++) {
            printf("*");
        }
    printf("\n");
    }
    printf("等腰三角形\n");
    for (int i = 1; i <= 5; i++) {
        for (int j = 1; j <= 5-i; j++) {
            printf(" ");
        }
        for (int j = 1; j <= i*2-1; j++) {
            printf("*");
        }
        printf("\n");
    }
    printf("\n打印菱形\n");
    for (int i = 1; i <= 5; i++) {
        for (int j = 1; j <= 5-i; j++) {
            printf(" ");
        }
        for (int j = 1; j <= i*2-1; j++) {
            printf("*");
        }
        printf("\n");
    }
    for (int i = 5-1; i >= 1; i--) {
        for(int j = 1;j<=5-i;j++) {
            printf(" ");
        }
        // 打印星号
        for (int j = 1; j <= 2 * i - 1; j++) {
            printf("*");
        }
        printf("\n");
    }
    bool flag = true;
    while (flag) {
    printf("\n输入1退出循环");
        int i = 0;
        scanf("%d",&i);
        if(i==1) {
            flag = false;
        }

    }
    for (int i = 1; i <= 5; i++) {
        for (int j = 1; j <= 5-i; j++) {
            goto a;
        }
    }
    a : printf("跳出了循环");
}
